//
//  TradeProModel.m
//  BlackBambooCM-OC
//
//  Created by DKang on 2018/12/13.
//  Copyright © 2018年 ucanmax. All rights reserved.
//

#import "TradeProModel.h"

@implementation TradeProModel
- (instancetype)initWithDic:(NSDictionary *)dict {
    self = [super init];
    if (self) {
        _goodsId = dict[@"goodsId"];
        _goodsName = dict[@"goodsName"];
        _goodsNum = dict[@"goodsNum"];
        _goodsSkuId = dict[@"goodsSkuId"];
        _goodsSkuPrice = dict[@"goodsSkuPrice"];
        _skuValue = dict[@"skuValue"];
    }
    return self;
}
/*
 获取商品属性 get
 */
+ (void)getGoodsproperty:(NSString *)goodsId complete:(void (^)(NSMutableArray * _Nonnull))complete onFailure:(void (^)(NSString * _Nonnull))failure {
    [[WYNetwork sharedWYNetwork] goodsproperty:goodsId success:^(id responseObject) {
        NSMutableArray *mutArray = [NSMutableArray new];
        NSArray *list = responseObject[@"goodsInventoryNumDtoList"];
        if(list){
            for (NSDictionary *dict in list) {
                TradeProModel *model = [[TradeProModel alloc]initWithDic:dict];
                [mutArray addObject:model];
            }
        }
        complete(mutArray);
    } failure:^(NSString *error) {
        failure(error);
    }];
}
@end
